
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_Hans">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Django 1.8.1 版本发行说明 &#8212; Django 3.2.11.dev 文档</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="Django 1.8 版本发行说明" href="1.8.html" />
    <link rel="prev" title="Django 1.8.2 版本发行说明" href="1.8.2.html" />



 
<script src="../templatebuiltins.js"></script>
<script>
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);</script>

  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django 3.2.11.dev 文档</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../index.html">Home</a>  |
        <a title="Table of contents" href="../contents.html">Table of contents</a>  |
        <a title="Global index" href="../genindex.html">Index</a>  |
        <a title="Module index" href="../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="1.8.2.html" title="Django 1.8.2 版本发行说明">previous</a>
     |
    <a href="index.html" title="发行说明" accesskey="U">up</a>
   |
    <a href="1.8.html" title="Django 1.8 版本发行说明">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="releases-1.8.1">
            
  <div class="section" id="s-django-1-8-1-release-notes">
<span id="django-1-8-1-release-notes"></span><h1>Django 1.8.1 版本发行说明<a class="headerlink" href="#django-1-8-1-release-notes" title="永久链接至标题">¶</a></h1>
<p><em>May 1, 2015</em></p>
<p>Django 1.8.1 fixes several bugs in 1.8 and includes some optimizations in the
migrations framework.</p>
<div class="section" id="s-bugfixes">
<span id="bugfixes"></span><h2>漏洞修复<a class="headerlink" href="#bugfixes" title="永久链接至标题">¶</a></h2>
<ul class="simple">
<li>Added support for serializing <a class="reference external" href="https://docs.python.org/3/library/datetime.html#datetime.timedelta" title="(在 Python v3.10)"><code class="xref py py-class docutils literal notranslate"><span class="pre">timedelta</span></code></a> objects in
migrations (<a class="reference external" href="https://code.djangoproject.com/ticket/24566">#24566</a>).</li>
<li>Restored proper parsing of the <a class="reference internal" href="../ref/django-admin.html#django-admin-testserver"><code class="xref std std-djadmin docutils literal notranslate"><span class="pre">testserver</span></code></a> command's positional
arguments (fixture names) (<a class="reference external" href="https://code.djangoproject.com/ticket/24571">#24571</a>).</li>
<li>Prevented <code class="docutils literal notranslate"><span class="pre">TypeError</span></code> in translation functions <code class="docutils literal notranslate"><span class="pre">check_for_language()</span></code> and
<code class="docutils literal notranslate"><span class="pre">get_language_bidi()</span></code> when translations are deactivated (<a class="reference external" href="https://code.djangoproject.com/ticket/24569">#24569</a>).</li>
<li>Fixed <a class="reference internal" href="../ref/django-admin.html#django-admin-squashmigrations"><code class="xref std std-djadmin docutils literal notranslate"><span class="pre">squashmigrations</span></code></a> command when using
<a class="reference internal" href="../ref/migration-operations.html#django.db.migrations.operations.SeparateDatabaseAndState" title="django.db.migrations.operations.SeparateDatabaseAndState"><code class="xref py py-class docutils literal notranslate"><span class="pre">SeparateDatabaseAndState</span></code></a>
(<a class="reference external" href="https://code.djangoproject.com/ticket/24278">#24278</a>).</li>
<li>Stripped microseconds from <code class="docutils literal notranslate"><span class="pre">datetime</span></code> values when using an older version of
the MySQLdb DB API driver as it does not support fractional seconds
(<a class="reference external" href="https://code.djangoproject.com/ticket/24584">#24584</a>).</li>
<li>Fixed a migration crash when altering
<a class="reference internal" href="../ref/models/fields.html#django.db.models.ManyToManyField" title="django.db.models.ManyToManyField"><code class="xref py py-class docutils literal notranslate"><span class="pre">ManyToManyField</span></code></a>s (<a class="reference external" href="https://code.djangoproject.com/ticket/24513">#24513</a>).</li>
<li>Fixed a crash with <code class="docutils literal notranslate"><span class="pre">QuerySet.update()</span></code> on foreign keys to one-to-one fields
(<a class="reference external" href="https://code.djangoproject.com/ticket/24578">#24578</a>).</li>
<li>Fixed a regression in the model detail view of
<a class="reference internal" href="../ref/contrib/admin/admindocs.html#module-django.contrib.admindocs" title="django.contrib.admindocs: Django's admin documentation generator."><code class="xref py py-mod docutils literal notranslate"><span class="pre">admindocs</span></code></a> when a model has a reverse foreign key
relation (<a class="reference external" href="https://code.djangoproject.com/ticket/24624">#24624</a>).</li>
<li>Prevented arbitrary file inclusions in <a class="reference internal" href="../ref/contrib/admin/admindocs.html#module-django.contrib.admindocs" title="django.contrib.admindocs: Django's admin documentation generator."><code class="xref py py-mod docutils literal notranslate"><span class="pre">admindocs</span></code></a>
(<a class="reference external" href="https://code.djangoproject.com/ticket/24625">#24625</a>).</li>
<li>Fixed a crash with <code class="docutils literal notranslate"><span class="pre">QuerySet.update()</span></code> on foreign keys to instances with
<code class="docutils literal notranslate"><span class="pre">uuid</span></code> primary keys (<a class="reference external" href="https://code.djangoproject.com/ticket/24611">#24611</a>).</li>
<li>Fixed database introspection with SQLite 3.8.9 (released April 8, 2015)
(<a class="reference external" href="https://code.djangoproject.com/ticket/24637">#24637</a>).</li>
<li>Updated <code class="docutils literal notranslate"><span class="pre">urlpatterns</span></code> examples generated by <a class="reference internal" href="../ref/django-admin.html#django-admin-startproject"><code class="xref std std-djadmin docutils literal notranslate"><span class="pre">startproject</span></code></a> to
remove usage of referencing views by dotted path in
<code class="docutils literal notranslate"><span class="pre">django.conf.urls.url()</span></code> which is deprecated in Django 1.8
(<a class="reference external" href="https://code.djangoproject.com/ticket/24635">#24635</a>).</li>
<li>Fixed queries where an expression was referenced in <code class="docutils literal notranslate"><span class="pre">order_by()</span></code>, but wasn't
part of the select clause. An example query is
<code class="docutils literal notranslate"><span class="pre">qs.annotate(foo=F('field')).values('pk').order_by('foo'))</span></code> (<a class="reference external" href="https://code.djangoproject.com/ticket/24615">#24615</a>).</li>
<li>Fixed a database table name quoting regression (<a class="reference external" href="https://code.djangoproject.com/ticket/24605">#24605</a>).</li>
<li>Prevented the loss of <code class="docutils literal notranslate"><span class="pre">null</span></code>/<code class="docutils literal notranslate"><span class="pre">not</span> <span class="pre">null</span></code> column properties during field
alteration of MySQL databases (<a class="reference external" href="https://code.djangoproject.com/ticket/24595">#24595</a>).</li>
<li>Fixed JavaScript path of <code class="docutils literal notranslate"><span class="pre">contrib.admin</span></code>’s related field widget when using
alternate static file storages (<a class="reference external" href="https://code.djangoproject.com/ticket/24655">#24655</a>).</li>
<li>Fixed a migration crash when adding new relations to models
(<a class="reference external" href="https://code.djangoproject.com/ticket/24573">#24573</a>).</li>
<li>Fixed a migration crash when applying migrations with model managers on
Python 3 that were generated on Python 2 (<a class="reference external" href="https://code.djangoproject.com/ticket/24701">#24701</a>).</li>
<li>Restored the ability to use iterators as queryset filter arguments
(<a class="reference external" href="https://code.djangoproject.com/ticket/24719">#24719</a>).</li>
<li>Fixed a migration crash when renaming the target model of a many-to-many
relation (<a class="reference external" href="https://code.djangoproject.com/ticket/24725">#24725</a>).</li>
<li>Removed flushing of the test database with <a class="reference internal" href="../ref/django-admin.html#cmdoption-test-keepdb"><code class="xref std std-option docutils literal notranslate"><span class="pre">test</span> <span class="pre">--keepdb</span></code></a>, which
prevented apps with data migrations from using the option (<a class="reference external" href="https://code.djangoproject.com/ticket/24729">#24729</a>).</li>
<li>Fixed <code class="docutils literal notranslate"><span class="pre">makemessages</span></code> crash in some locales (<a class="reference external" href="https://code.djangoproject.com/ticket/23271">#23271</a>).</li>
<li>Fixed help text positioning of <code class="docutils literal notranslate"><span class="pre">contrib.admin</span></code> fields that use the
<code class="docutils literal notranslate"><span class="pre">ModelAdmin.filter_horizontal</span></code> and <code class="docutils literal notranslate"><span class="pre">filter_vertical</span></code> options
(<a class="reference external" href="https://code.djangoproject.com/ticket/24676">#24676</a>).</li>
<li>Fixed <code class="docutils literal notranslate"><span class="pre">AttributeError:</span> <span class="pre">function</span> <span class="pre">'GDALAllRegister'</span> <span class="pre">not</span> <span class="pre">found</span></code> error when
initializing <code class="docutils literal notranslate"><span class="pre">contrib.gis</span></code> on Windows.</li>
</ul>
</div>
<div class="section" id="s-optimizations">
<span id="optimizations"></span><h2>Optimizations<a class="headerlink" href="#optimizations" title="永久链接至标题">¶</a></h2>
<ul class="simple">
<li>Changed <code class="docutils literal notranslate"><span class="pre">ModelState</span></code> to deepcopy fields instead of deconstructing and
reconstructing (<a class="reference external" href="https://code.djangoproject.com/ticket/24591">#24591</a>). This speeds up the rendering of model
states and reduces memory usage when running <a class="reference internal" href="../ref/django-admin.html#django-admin-migrate"><code class="xref std std-djadmin docutils literal notranslate"><span class="pre">manage.py</span> <span class="pre">migrate</span></code></a> (although other changes in this release may negate any performance
benefits).</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Django 1.8.1 版本发行说明</a><ul>
<li><a class="reference internal" href="#bugfixes">漏洞修复</a></li>
<li><a class="reference internal" href="#optimizations">Optimizations</a></li>
</ul>
</li>
</ul>

  <h4>上一个主题</h4>
  <p class="topless"><a href="1.8.2.html"
                        title="上一章">Django 1.8.2 版本发行说明</a></p>
  <h4>下一个主题</h4>
  <p class="topless"><a href="1.8.html"
                        title="下一章">Django 1.8 版本发行说明</a></p>
  <div role="note" aria-label="source link">
    <h3>本页</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/releases/1.8.1.txt"
            rel="nofollow">显示源代码</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>快速搜索</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="转向" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">12月 07, 2021</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="1.8.2.html" title="Django 1.8.2 版本发行说明">previous</a>
     |
    <a href="index.html" title="发行说明" accesskey="U">up</a>
   |
    <a href="1.8.html" title="Django 1.8 版本发行说明">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>